package com.ruoyi.system.domain;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class OrderContrastDetailConverter implements Converter<Integer> {

    @Override
    public Class<Integer> supportJavaTypeKey() {
        return Integer.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public WriteCellData<String> convertToExcelData(Integer status, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        String statusStr = "未知";
        if (status == 1) {
            statusStr = "成功";
        } else if (status == 2) {
            statusStr = "失败";
        }
        return new WriteCellData<>(statusStr);
    }
}
